package com.sy.service.impl;


import com.sy.exception.BusinessException;
import com.sy.mapper.*;
import com.sy.service.HomeworkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;


@Service
public abstract class BaseServiceImpl {
    @Autowired
    protected StudentMapper studentMapper;
    @Autowired
    protected TeacherMapper teacherMapper;
    @Autowired
    protected AdminMapper adminMapper;
    @Autowired
    protected AnnouncementMapper announcementMapper;
    @Autowired
    protected ClassMsgMapper classMsgMapper;
    @Autowired
    protected HomeworkMapper homeworkMapper;
    @Autowired
    protected StudyFileMapper studyFileMapper;
    @Autowired
    protected ScoreMapper scoreMapper;
    @Autowired
    protected NewLeavenWordsMapper newLeavenWordsMapper;
    @Autowired
    protected LeaveMsgMapper leaveMsgMapper;
    @Autowired
    protected AnswerMapper answerMapper;


    /**
     * 生成新的Exception
     * @param httpStatus Http状态码
     * @param errMsg 错误信息
     */
    protected void buildError(HttpStatus httpStatus , String errMsg) {
        throw new BusinessException( httpStatus,errMsg);
    }
}
